//
//  AppDelegate.h
//  WubiTest
//
//  Created by MingmingSun on 2019/12/6.
//  Copyright © 2019 Sunmingming. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <Colours.h>
#import <DNSInAppPurchaseManager.h>
#import <Masonry.h>
#import "tooles.h"

//全局变量
#define APPALL ((AppDelegate*)[[UIApplication sharedApplication] delegate])
#define kViewWidth self.view.frame.size.width
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

typedef enum {
    EStoreNotReached = 0,
    EStoreCanPay,
    EStoreCanNotPay,
    EStoreReachFailed,
}EReachedTag;

static NSString * const kIAPOpenLevel = @"OpenLevel";

@protocol VCIAPDelegate<NSObject>
@optional
- (void)VCIAPSucceed:(NSString*)aSucc;
- (void)VCIAPFailed:(NSString*)aSucc;
@end

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (nonatomic, strong) DNSInAppPurchaseManager *iapManager;
@property (nonatomic, strong) NSArray *availableProducts;
@property (nonatomic, strong) NSString *myNowAppId;
@property (nonatomic, assign) int storePayStatus;

@property (strong, nonatomic) UIWindow *window;

@property(nonatomic,assign) id<VCIAPDelegate> myIAPDelegate;
-(void)startToIAP:(NSString*)aIAP;
-(void)startToRestore:(NSString*)aIAP;

@property(nonatomic,strong) NSUserDefaults *mydefaults;


@end

